import requests
import json


class SuggestAppNameCloneApi:
    def __init__(self):
        pass

    def suggest_app_name_clone(self):
        headers = {
            "User-Agent": "RestSharp/107.3.0.0",
            "Accept": "application/json, text/json, text/x-json, text/javascript, application/xml, text/xml",
            "timezone": "%2b08%3a00",
            "ipv4": "192.168.43.133",
            "Accept-Language": "zh-CN,zh;q=1",
            "Authorization": "bearer b5bc7285-8719-4b40-8757-c586850453ac"
        }
        url = "https://api.winrobot360.com/api/client/app/develop/suggestAppName"
        params = {
            "appType": "activity",
            "suggestType": "clone",
            "appName": "CDR文件内容自动化"
        }
        response = requests.get(url, headers=headers, params=params)
        try:
            json_data = response.json()
            formatted_json = json.dumps(json_data, indent=4, ensure_ascii=False)
            print(formatted_json)
        except json.JSONDecodeError:
            print("Response is not valid JSON:")
            print(response.text)

        print(response)


if __name__ == '__main__':
    SuggestAppNameCloneApi().suggest_app_name_clone()
